package com.github.lee.unsplash.utils.ba

import androidx.annotation.ColorInt
import androidx.databinding.BindingAdapter
import com.coorchice.library.SuperTextView
import com.github.lee.core.common.dp2px


@BindingAdapter(value = ["solid","stroke_color", "stroke_width"], requireAll = false)
fun stroke(
    view: SuperTextView,
    @ColorInt solidColor: Int?,
    @ColorInt strokeColor: Int?,
    strokeWidthDp: Float?
) {
    if (null != solidColor) {
        view.solid = solidColor
    }

    if (null != strokeColor) {
        view.strokeColor = strokeColor
        view.strokeWidth = dp2px(view.context, strokeWidthDp ?: 0F)
    }


}